package logic

import (
	"context"
	"yk-travel-social/common/proto/travel"
	"yk-travel-social/service/server"
)

type ServerTravel struct {
	travel.UnimplementedTravelServer
}

func (s ServerTravel) Login(ctx context.Context, in *travel.LoginRequest) (*travel.LoginResponse, error) {
	login, err := server.Login(in)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (s ServerTravel) Search(ctx context.Context, in *travel.SearchRequest) (*travel.SearchResponse, error) {
	login, err := server.Search(in)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (s ServerTravel) ShowInfo(ctx context.Context, in *travel.ShowInfoRequest) (*travel.ShowInfoResponse, error) {
	login, err := server.ShowInfo(in)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (s ServerTravel) BuyTicket(ctx context.Context, in *travel.BuyTicketRequest) (*travel.BuyTicketResponse, error) {
	login, err := server.BuyTicket(in)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (s ServerTravel) AddPurchaser(ctx context.Context, in *travel.AddPurchaserRequest) (*travel.AddPurchaserResponse, error) {
	login, err := server.AddPurchaser(in)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (s ServerTravel) AlipayBack(ctx context.Context, in *travel.AlipayBackRequest) (*travel.AlipayBackResponse, error) {
	login, err := server.AlipayBack(in)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (s ServerTravel) ShowOrder(ctx context.Context, in *travel.ShowOrderRequest) (*travel.ShowOrderResponse, error) {
	login, err := server.ShowOrder(in)
	if err != nil {
		return nil, err
	}
	return login, nil
}
